package cn.wwk.notification.search.service;

import cn.wwk.notification.common.result.Result;
import cn.wwk.notification.search.doc.IndexParams;

import java.io.IOException;

/**
 * 通用的索引库操作
 *
 * @author wwk
 */
public interface CommonIndexService {

    /**
     * Create index.
     *
     * @param index 索引库对象
     * @throws IOException the io exception
     */
    Result createIndex(IndexParams index) throws IOException;

    /**
     * Delete index.
     *
     * @param indexName the index name
     * @throws IOException the io exception
     */
    void deleteIndex(String indexName) throws IOException;

    /**
     * Exists index.
     *
     * @param indexName the index name
     * @return the boolean
     * @throws IOException the io exception
     */
    boolean existsIndex(String indexName) throws IOException;
}
